﻿@using Fyp.Models;

@{
    ViewBag.Title = "MeetingSchedulerList";
}

@{
    Layout = "~/Shared/_layoutPage.cshtml";
    var PageTitle = "Meeting Scheduler List";

    var data = (List<MeetingScheduler>)ViewData["data"];

 }
   
@section title
{
    @PageTitle
}
   
   
<style>
table, td, th
{
border:1px solid green;
padding:2px;
}
th
{
background-color:green;
color:white;
padding:2px;
}
</style>

     <strong>
            <div id="content" style="margin-left: 46px;margin-bottom: -1px;">
                 <h2 style="text-align: center;">Meeting Scheduler List</h2>                
             </div>
    </strong>

    @using (Html.BeginForm("SearchMeeting", "MeetingScheduler", FormMethod.Post, new { @class = "background" }))
    { 
       <input type ="text" id="search" name="search" placeholder ="Search Scheduled Meetings..." style="width: 182px;margin-top: -53px; margin-left: 708px;" />
       <input type="submit"  value="Search"  class ="buttonSave" style="margin-left: 893px;margin-top: -54px;height: 22px; width: 53px;padding: 1px; padding-right: 49px;padding-left: 5px;" />
    

    
    <table class = "table" style=" margin-left: 66px; margin-right: 139px;">
     <thead>
           <tr>
               <th class="table">Meeting Title</th>
               <th class="table">Meeting Type</th>
               <th class="table">Meeting Location</th>
               <th class="table">Meeting Date</th>
                @if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("Advisor"))
                {
                    <th class="table"></th>
                }
               else
               {
                    <th class="table"></th>
               }
           </tr>
       </thead>
       <tbody> 
       @foreach (var row in data)
       {
           <tr>
                   <td class="table">@row.MeetingTitle</td>
                   <td class="table">@row.MeetingType</td>
                   <td class="table">@row.MeetingLocation</td>
                   <td class="table">@row.MeetingDate.Value.ToString("dd/MM/yyyy")</td>
                   
                   <td><a href='@Url.Action("MeetingScheduler", "MeetingScheduler", new { Id = @row.MeetingId})'><u>View Details</u></a></td>
                  
            </tr>
       }
        </tbody>
    </table>         
}